﻿<?php
require_once dirname(__FILE__) . '/control/PgSQL.php';

$idhotel = $_GET['id'];
$content = $_POST['content'];
$creater = $_POST['name'];
$pg = new PgSQL();
$pg->connect();
$sql = "INSERT INTO comment(id, content, creater, date) VALUES ('{$idhotel}','{$content}','{$creater}', now())";
$url = "Location: comment.php?id=".$idhotel."&insert=";
if ($pg->query($sql))
{
	header($url."1");
}
else
{
	header($url."0");
}
$pg->disconnect();
?>